﻿@inherits System.Web.Mvc.WebViewPage
@{
    Layout = "_Page.cshtml";
    List<PageWidget> widgets = null;
    if (ViewBag.Page != null)
    {
        widgets = ((Vit.Web.Models.WebPage)ViewBag.Page).GetWidgets();
    }
    PageMode currPageMode = PageMode.Visit;
    if (TempData["CurrentPageMode"] != null)
    {
        currPageMode = (PageMode)TempData["CurrentPageMode"];
    }
}
@section styles {
}
@section scripts {
}
@section top {
    @Html.Partial("_Top")
}
@section header {
    @Sections.Render(currPageMode, "header", ViewBag.Page.Name,
                widgets == null ? null : Widgets.Render(widgets, this, currPageMode, "header"))
}
@section footer {
    @Sections.Render(currPageMode, "footer", ViewBag.Page.Name,
                widgets == null ? null : Widgets.Render(widgets, this, currPageMode, "footer"))
}
@section left{
    @Sections.Render(currPageMode, "left", ViewBag.Page.Name,
                widgets == null ? null : Widgets.Render(widgets, this, currPageMode, "left"))
}
@section right{
    @Sections.Render(currPageMode, "right", ViewBag.Page.Name,
                widgets == null ? null : Widgets.Render(widgets, this, currPageMode, "right"))
}
@Sections.Render(currPageMode, "body", ViewBag.Page.Name,
        widgets == null ? null : Widgets.Render(widgets, this, currPageMode, new string[] { "header", "footer", "left", "right" }))
